\hypertarget{class_r_t_o_s_1_1flag}{\section{R\-T\-O\-S\-:\-:flag Class Reference}
\label{class_r_t_o_s_1_1flag}\index{R\-T\-O\-S\-::flag@{R\-T\-O\-S\-::flag}}
}


basic synchronisation mechanism.  




{\ttfamily \#include $<$p\-R\-T\-O\-S.\-h$>$}

Inheritance diagram for R\-T\-O\-S\-:\-:flag\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{class_r_t_o_s_1_1flag}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_r_t_o_s_1_1flag_a2d05d296b33e6cbc141fd4fb5e6f2740}{flag} (\hyperlink{class_r_t_o_s_1_1task}{task} $\ast$\hyperlink{class_r_t_o_s_1_1event_a1402687edb26c1d5d26e54dbda21919d}{t}, const char $\ast$name=\char`\"{}\char`\"{})
\begin{DoxyCompactList}\small\item\em constructor, specify onwer and name \end{DoxyCompactList}\item 
void \hyperlink{class_r_t_o_s_1_1flag_aae862c6b7c385a4920d9a486e25ad5d8}{set} (void)
\begin{DoxyCompactList}\small\item\em sets the flag \end{DoxyCompactList}\item 
\hypertarget{class_r_t_o_s_1_1flag_a38ac8e72fcd0b7bcc45fd00acb156cbb}{void \hyperlink{class_r_t_o_s_1_1flag_a38ac8e72fcd0b7bcc45fd00acb156cbb}{print} (std\-::ostream \&s, bool header=true) const }\label{class_r_t_o_s_1_1flag_a38ac8e72fcd0b7bcc45fd00acb156cbb}

\begin{DoxyCompactList}\small\item\em prints flag infomation (for debugging) \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_r_t_o_s_1_1flag_aa5b30b5b619f01a5d94b779bf0e58610}{class {\bfseries R\-T\-O\-S}}\label{class_r_t_o_s_1_1flag_aa5b30b5b619f01a5d94b779bf0e58610}

\end{DoxyCompactItemize}
\subsection*{Additional Inherited Members}


\subsection{Detailed Description}
basic synchronisation mechanism. 

\begin{DoxyVerb}  The basic synchronization mechanism is the (event) flag. 
  Like all waitables, a flag is created for a particular task. 
  A flag is set by a flag::set() call (or the task::set( flag) 
  call, which has the same effect). 
  Like all waitables, when a task is waiting for a flag 
  (using a task::wait call) and that flag becomes set, 
  the wait call will clear the flag, and return an event 
  that compares equal to the flag. 
  Note that a flag does not count: setting a flag that is 
  already set has no effect on the flag.

  A flag must be created for a specific task.
  The normal place to do this is in the task's creator.
  An flag is initially cleared.

  The example below shows a led_task that responds to two event flags. 
  The shift flag will cause it to shift the pattern on the LEDs one 
  position to the left, while the invert flag will cause it 
  to invert the pattern. 
  Two addional tasks do notghing but set these flags at fixed intervals. 
  The result is a sort of one-direction Kitt display, 
  which will occasionally flip polarity. 
  Note that in this example the wait call excplicitly 
  mentions the flags it waits for.

  @code 
\end{DoxyVerb}
 T\-B\-W  

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_r_t_o_s_1_1flag_a2d05d296b33e6cbc141fd4fb5e6f2740}{\index{R\-T\-O\-S\-::flag@{R\-T\-O\-S\-::flag}!flag@{flag}}
\index{flag@{flag}!RTOS::flag@{R\-T\-O\-S\-::flag}}
\subsubsection[{flag}]{\setlength{\rightskip}{0pt plus 5cm}R\-T\-O\-S\-::flag\-::flag (
\begin{DoxyParamCaption}
\item[{{\bf task} $\ast$}]{t, }
\item[{const char $\ast$}]{name = {\ttfamily \char`\"{}\char`\"{}}}
\end{DoxyParamCaption}
)}}\label{class_r_t_o_s_1_1flag_a2d05d296b33e6cbc141fd4fb5e6f2740}


constructor, specify onwer and name 

This call creates a timer for task t. The name is used for debugging and statistics. 

\subsection{Member Function Documentation}
\hypertarget{class_r_t_o_s_1_1flag_aae862c6b7c385a4920d9a486e25ad5d8}{\index{R\-T\-O\-S\-::flag@{R\-T\-O\-S\-::flag}!set@{set}}
\index{set@{set}!RTOS::flag@{R\-T\-O\-S\-::flag}}
\subsubsection[{set}]{\setlength{\rightskip}{0pt plus 5cm}void R\-T\-O\-S\-::flag\-::set (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{class_r_t_o_s_1_1flag_aae862c6b7c385a4920d9a486e25ad5d8}


sets the flag 

Setting a flag causes the task that waits for this flag to be awakened. 

Reimplemented from \hyperlink{class_r_t_o_s_1_1waitable_a3a72bdf94092471e82ba2d04cdc4a58e}{R\-T\-O\-S\-::waitable}.



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
p\-R\-T\-O\-S.\-h\item 
p\-R\-T\-O\-S.\-cpp\end{DoxyCompactItemize}
